<h2><?php echo $this->translate('TITLE_ADMIN_SHOWS_UPDATE'); ?></h2>
<?php
$msg = '';
if (count($this->message) > 0) {
    $msg .='<div class="block_content">';
    foreach ($this->message as $message) {
        $msg .= '<div class="message ' . $message['type'] . '"><p>' . $message['text'] . '</p></div>' . "\n";
    }
    $msg .='</div>';
}
echo $msg;
?>

<form name="frmInsertShows" enctype="multipart/form-data" action="" method="post">
    <?php echo $this->formHidden('show_type', 1); ?>
    <dl class="zend_form">
        <dt id="post_parent-label"><label for="post_parent" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_PARTNER'); ?></label></dt>
        <dd id="post_parent-element">
            <?php echo $this->formSelect('post_parent', $this->data['post_parent'], null, $this->options_menu); ?>
        </dd>
        <dt id="post_title-label"><label for="post_title" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_NAME'); ?></label></dt>
        <dd id="post_title-element">
            <?php echo $this->formText('post_title', $this->data['post_title'], array('size' => 50, 'maxlength' => 255)); ?>
        </dd>        
        <dt id="post_content-label"><label for="post_content" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_CONTENT'); ?></label></dt>
        <dd id="post_content-element">
            <?php echo $this->formTextarea('post_content', $this->data['post_content'], array('rows' => 10, 'cols' => 50)); ?>
        </dd>
        <dt id="show_image-label"><label for="show_image" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_LOGO'); ?></label></dt>
        <dd id="show_image-element">
            <?php echo $this->formFile('show_image'); ?>
        </dd>        
        <dt id="show_date_start-label"><label for="show_date_start" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_DATE_START'); ?></label></dt>
        <dd id="show_date_start-element">
            <?php echo $this->formText('show_date_start', $this->data_meta['show_date_start'], array('size' => 30, 'maxlength' => 10)); ?>
        </dd>
        <dt id="show_date_start_sell-label"><label for="show_date_start_sell" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_DATE_START_SELL'); ?></label></dt>
        <dd id="show_date_start_sell-element">
            <?php echo $this->formText('show_date_start_sell', $this->data_meta['show_date_start_sell'], array('size' => 30, 'maxlength' => 10)); ?>
        </dd>
        <dt id="show_date_end_sell-label"><label for="show_date_end_sell" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_DATE_END_SELL'); ?></label></dt>
        <dd id="show_date_end_sell-element">
            <?php echo $this->formText('show_date_end_sell', $this->data_meta['show_date_end_sell'], array('size' => 30, 'maxlength' => 10)); ?>
        </dd>
        <dt id="show_max_buy_ticket-label"><label for="show_max_buy_ticket"  class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_DATE_MAX_BUY_TICKET'); ?></label></dt>
        <dd id="show_max_buy_ticket-element">
            <?php echo $this->formText('show_max_buy_ticket', $this->data_meta['show_max_buy_ticket'], array('size' => 30, 'maxlength' => 10)); ?>
        </dd>
        <dt id="show_address-label"><label for="show_address"  class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_ADDRESS'); ?></label></dt>
        <dd id="show_address-element">
            <?php echo $this->formText('show_address', $this->data_meta['show_address'], array('size' => 50, 'maxlength' => 255)); ?>
        </dd>
        <dt id="show_google_map-label"><label for="show_google_map" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_GOOGLE_MAP'); ?></label></dt>
        <dd id="show_google_map-element">
            <?php echo $this->formText('show_google_map', $this->data_meta['show_google_map'], array('size' => 50, 'maxlength' => 255)); ?>
        </dd>
        <dt id="show_google_map-label"><label for="show_partner" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_PARTNER'); ?></label></dt>
        <dd id="show_google_map-element">
            <?php echo $this->formSelect('show_partner', $this->data_meta['show_partner'], null, $this->options_partner); ?>
        </dd>
        <dt id="post_ticket_price-label"><label for="post_ticket_price" class="required"><?php echo $this->translate('LABEL_ADMIN_SHOWS_TICKET_AND_PRICE'); ?></label></dt>
        <dd id="post_ticket_price-element">            
            <ul class="show_prices" id="manage_price_show">
                <?php
                $prices_options = unserialize($this->data_meta['show_stands']);
                if (sizeof($prices_options)) {
                    $i = 0;
                    foreach ($prices_options as $stand_id => $stand_values) {
                        $i++;
                        echo '<li>
                            <div>' . $this->translate('LABEL_ADMIN_SHOWS_STANDS') . $this->formSelect('show_stands[]', $stand_id, array('multiple' => false), $this->options_stands) . '</div>
                            <div>' . $this->translate('LABEL_ADMIN_SHOWS_QUANTITY_TICKET') . $this->formText('show_quantity_ticket[]', $stand_values['show_quantity_ticket'], array('size' => 10, 'maxlength' => 255)) . '</div>
                            <div>' . $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_DISPLAY') . $this->formText('show_price_display[]', $stand_values['show_price_display'], array('size' => 10, 'maxlength' => 255)) . '</div>
                            <div>' . $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_SELL') . $this->formText('show_price_sell[]', $stand_values['show_price_sell'], array('size' => 10, 'maxlength' => 255)) . '</div>
                            <div></div>';
                        if($i==1){
                            echo '<div onclick="add_new_price_manage()"><img src="'.$this->baseUrl('public/images/admin_icon/add_icon.png').'" border="0" /></div>';
                        }else{
                            echo '<div onclick="remove_new_price_manage(this)"><img src="'.$this->baseUrl('public/images/admin_icon/remove_icon.png').'" border="0" /></div>';
                        }
                        echo '<div style="clear: both;"></div>
                        </li>';
                    }
                } else {
                    ?>
                    <li>
                        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_STANDS'); ?><?php echo $this->formSelect('show_stands[]', '', array('multiple' => false), $this->options_stands); ?></div>
                        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_QUANTITY_TICKET'); ?><?php echo $this->formText('show_quantity_ticket[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
                        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_DISPLAY'); ?><?php echo $this->formText('show_price_display[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
                        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_SELL'); ?><?php echo $this->formText('show_price_sell[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
                        <div onclick="add_new_price_manage()"><img src="<?php echo $this->baseUrl('public/images/admin_icon/add_icon.png') ?>" border="0" /></div>
                        <div style="clear: both;"></div>
                    </li>
                    <?php
                }
                ?>
            </ul>
            <div style="clear: both;"></div>
        </dd>
        <dt id="post_order-label"><label for="post_order"><?php echo $this->translate('LABEL_ADMIN_SHOWS_ORDER'); ?></label></dt>
        <dd id="post_order-element">
            <?php echo $this->formText('post_order', $this->data['post_order'], array('size' => 20, 'maxlength' => 10)); ?>
        </dd> 

        <dt id="post_status-label"><label for="post_status"><?php echo $this->translate('LABEL_ADMIN_SHOWS_STATUS'); ?></label></dt>
        <dd id="post_status-element">
            <?php echo $this->formCheckbox('post_status', null, array('checked' => $this->data['post_status'])); ?>            
        </dd>
        <dd>
            <?php echo $this->formSubmit('submit', 'Submit', array('class' => 'formbutton')); ?>
        </dd>
    </dl>
</form>
<div style="display: none;" id="html_price_add">
    <li>
        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_STANDS'); ?><?php echo $this->formSelect('show_stands[]', '', array('multiple' => false), $this->options_stands); ?></div>
        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_QUANTITY_TICKET'); ?><?php echo $this->formText('show_quantity_ticket[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_DISPLAY'); ?><?php echo $this->formText('show_price_display[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
        <div><?php echo $this->translate('LABEL_ADMIN_SHOWS_TICKET_PRICE_SELL'); ?><?php echo $this->formText('show_price_sell[]', '', array('size' => 10, 'maxlength' => 255)); ?></div>
        <div onclick="remove_new_price_manage(this)"><img src="<?php echo $this->baseUrl('public/images/admin_icon/remove_icon.png') ?>" border="0" /></div>
        <div style="clear: both;"></div>
    </li>
</div>
<script type="text/javascript">
    CKEDITOR.replace( 'post_content', {
        width : '900',
        height: '300'
    } );
    AnyTime.picker( "show_date_start",{});
    AnyTime.picker( "show_date_start_sell",{});
    AnyTime.picker( "show_date_end_sell",{});
</script>